home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
monitory
/
amyload
/
newscale.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-15
|
1KB
|
52 lines
#include <exec/types.h>
#include <exec/lists.h>
#include <devices/load.h>
#include "execdef.h"
#include "loadrecord.h"
#include "windowinfo.h"
#include "NewScale.proto"
extern loadrequest *loadRequest;
extern long maxTicks;
extern long maxChip;
extern long maxFast;
extern long maxMem;
Bool
NewScale(window_info, record, data_value)
WindowInfo *window_info;
LoadRecord *record;
LoadDataValue data_value;
{
short new_scale;
long max_value;
switch(record->type)
{
case CPU:
case BLITTER:
max_value = maxTicks;
break;
case CHIPMEM:
max_value = maxChip;
break;
case FASTMEM:
max_value = maxFast;
break;
case ALLMEM:
max_value = maxMem;
break;
}
new_scale = data_value / max_value + 1;
if (new_scale != record->scale)
{
record->scale = new_scale;
record->scaled_ticks = new_scale * max_value;
record->deltay = window_info->height / new_scale;
record->moduloy = window_info->height % new_scale;
return TRUE;
}
return FALSE;
}